fix(ci): enable Actions PR creation so mcp-toplist-badge.yml's refresh actually runs (#273) - #290
Merged
Merged
Conversation
Root cause of #273: the repo's "Allow GitHub Actions to create and approve pull requests" setting (Settings -> Actions -> General) was unchecked, which blocks peter-evans/create-pull-request from creating a PR at all -- a stronger failure than the workflow's comment anticipated (it only described why a GITHUB_TOKEN-authored PR's own checks wouldn't start, not why creation itself could be refused). Fixed at the repo-policy layer via the GitHub API (actions/permissions/workflow, can_approve_pull_request_reviews=true) -- not in the workflow file, which already had the correct BADGE_REFRESH_TOKEN||GITHUB_TOKEN fallback and needed no logic change. The workflow comment now documents both distinct failure modes plus the fix and the PAT fallback for if the policy is ever reset. Verified: actionlint clean, the 51 tests_py/scripts/test_refresh_mcp_ toplist_badge.py tests pass unchanged (no script logic touched), no stray chore/mcp-toplist-badge-refresh branch exists. Refs #273 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
cdeust
force-pushed
the
fix-toplist-badge-pr-permission-273
branch
from
July 30, 2026 08:59
46c2b87 to
2b086e4
Compare
cdeust
added a commit
that referenced
this pull request
Jul 30, 2026
PRs opened with the default GITHUB_TOKEN do not trigger workflows (GitHub's documented behaviour, and noted in this repo's own CHANGELOG for exactly this workflow), so #289's required CI checks never started and it sat MERGEABLE/BLOCKED with only the 4 CodeQL checks reported. An empty commit pushed from a user credential starts them. #290 fixed the repo setting that prevents Actions from opening these PRs at all; this unblocks the one already open.
cdeust
added a commit
that referenced
this pull request
Jul 30, 2026
* chore: refresh MCP Toplist rank badge * chore: trigger CI on this badge-refresh PR PRs opened with the default GITHUB_TOKEN do not trigger workflows (GitHub's documented behaviour, and noted in this repo's own CHANGELOG for exactly this workflow), so #289's required CI checks never started and it sat MERGEABLE/BLOCKED with only the 4 CodeQL checks reported. An empty commit pushed from a user credential starts them. #290 fixed the repo setting that prevents Actions from opening these PRs at all; this unblocks the one already open. --------- Co-authored-by: cdeust <3167767+cdeust@users.noreply.github.com> Co-authored-by: cdeust <cdeust@icloud.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #273.
mcp-toplist-badge.yml's monthly refresh reachedOpen refresh PRand failed there —
GitHub Actions is not permitted to create or approve pull requests— because this repo's Settings → Actions → General → "AllowGitHub Actions to create and approve pull requests" was unchecked. That
blocks PR creation itself, a stronger failure than the workflow's own
comment anticipated (which only explained why a
GITHUB_TOKEN-authored PR'sown checks don't start, not why creation could be refused outright).
Fix
Root cause fixed at the repo-policy layer (issue AC1(a)), not in the
workflow — its
secrets.BADGE_REFRESH_TOKEN || secrets.GITHUB_TOKENfallbackwas already correct and needed no logic change:
Verified live:
The workflow's comment is updated to document both distinct failure modes
(checks-don't-start vs. creation-refused) and the fix, plus the
BADGE_REFRESH_TOKENPAT fallback for if the org/repo policy is ever reset(repo transfer, policy audit, etc.) — so a future recurrence is diagnosable
from the file alone without re-deriving the two-mode analysis.
AC2 evidence — real
workflow_dispatchrun,conclusion: successFirst verification attempt was dispatched against my fix branch by mistake
(
--ref fix-toplist-badge-pr-permission-273), which madepeter-evans/create-pull-requestopen the PR against that branch instead ofmain(PR #288) — closed + branch deleted immediately, no code or repo-stateeffect, documented so it isn't mistaken for a second incident.
Correct run, dispatched on
main(the branch the setting change alreadyapplies to, being a repo-level policy, not code):
completed / successdiff (
assets/badge-mcp-toplist.svg, +7/-7, current upstream rank/percentile),the routine monthly refresh, not a synthetic no-op. Left open for the
maintainer/coordinator to review and merge (not merged by me, per this
task's "do not merge" instruction) — its own
CodeQLchecks passed;Lint/Test/etc. (thepull_request-triggered required checks) did notstart, which is the documented, pre-existing, separate limitation of a
GITHUB_TOKEN-authored PR (failure mode 1 in the updated comment) — not adefect this issue's AC asks me to close, and no
BADGE_REFRESH_TOKENPATsecret exists in this repo to avoid it (
gh secret list— empty).AC3 evidence — no stray branch left behind
returned
404before either verification run (the earlier failing run'sstray branch had already been deleted per #273's own report). After my two
dispatches: the first (wrong-base) attempt's PR #288 was closed and its
branch deleted immediately; the second (correct) run's branch now backs the
still-open, real-content PR #289 — not stray, by the same definition #273
uses (a stray branch is one pushed with no accompanying PR).
Blast radius / stakes
toggle (no application code, no schema, no runtime behavior change for any
consumer-facing tool).
no partial-rollout notion; this matches Move 3's "infra change, no
user-visible behavior" case.
gh api -X PUT repos/cdeust/Cortex/actions/permissions/workflow -F can_approve_pull_request_reviews=falsereverts the setting instantly (RTO: seconds, RPO: none — it's a policy flag, not data);git revertreverts the comment/CHANGELOG edit. Both tested paths (the PUT command above was run and re-verified via GET in this PR; git revert is a standard, always-available Git operation for a 2-file diff).Completion Ledger (§13.2)
can_approve_pull_request_reviews: truegh api repos/cdeust/Cortex/actions/permissions/workflow→true, quoted aboveactionlint -color .github/workflows/mcp-toplist-badge.yml→ exit 0; reviewer readgit diff --statshows only the workflow comment + CHANGELOG;pytest tests_py/scripts/test_refresh_mcp_toplist_badge.py→ 51 passed, unchangedCHANGELOG.mddiff,### Fixedsectionworkflow_dispatchrun succeeds (AC2)conclusion: success, log quoted abovebranches/chore%2Fmcp-toplist-badge-refresh404 pre-run; post-run branch backs open PR #289, not strayRules compliance
Test-count docs
Not touched — no test added, removed, or modified;
tests_py/scripts/test_refresh_mcp_toplist_badge.py's 51 tests are unchanged and pass..bestpractices.json/CLAUDE.md/CONTRIBUTING.md/README.md/docs/ASSURANCE-CASE.md/assets/badge-tests.svg counts are unaffected.Closes #273.